<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ page import="cn.edu.hpu.entity.*" %>
<!DOCTYPE HTML>
<html>
	<head>
		<meta charset="UTF-8">
		<script type="text/javascript" src="bootstrap/jquery.js"></script>
		<script type="text/javascript" src="bootstrap/bootstrap.min.js"></script>
		<link rel="stylesheet" type="text/css" href="bootstrap/bootstrap.min.css" />
		
		<style type="text/css">
			body{
				background-image:url("bootstrap/backgroundimg.png");
				font-family:"微软雅黑";
				
				color:black;
			}
			
			.div1{
				margin-left:20px;
				width:500px;
				height:auto;
				border:1px,soild,black;
				
			}
			
			.div3{
				
				border: 1px solid #DDDDDD;
				border-style: none solid solid;
				border-width: medium 1px 1px;
				padding: 15px;
				margin-bottom:20px;
				padding-left:10px;
				padding-top:20px;
				background-color:white;
			}
			
			
		</style>
	</head>
	<body>
	
		<div class="div1">
			<ul class="breadcrumb" style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:15px">
				<li class="active">
					<i class="icon-folder-open"></i><a href="prod.jspx?method=document">资料</a>
				</li>
				<li class="pull-right">
					<i class="icon-plus"></i><a href="prod.jspx?method=new_document" class="link-black">分享新资料</a>
				</li>
			</ul>
			
				
					<div class="div3">
				<c:forEach items="${requestScope.documentList}" var="d">
					<!--需要循环输出-->
						<h4><a href="prod.jspx?method=document_show&id=${d.did} ">${d.dtitle}</a></h4><!--资料标题，点击此链接可进入资料显示页-->
						<p>${d.dcontent}</p><!--资料内容-->
						<small>${sessionScope.employee.ename}发布于${d.dctime}</small><!--资料发布的时间--><br/>
						<a class="update_link" rel="${d.did }" href="javascript:;">编辑</a>&nbsp;&nbsp;&nbsp;
						<a class="del_link" rel="${d.did }" href="javascript:;">删除</a>
				</c:forEach>	
			</div>
			
		</div>
	 <script type="text/javascript">
    	$(document).ready(function(){
    		$(".del_link").click(function(){
    			var id = $(this).attr("rel");
    			if(confirm("确定要删除此数据？")) {
					window.location.href = "prod.jspx?method=delDocument&id=" + id;
    			}
    			
    		});
    		$(".update_link").click(function(){
    			var id =$(this).attr("rel");
    			window.location.href="prod.jspx?method=updateDocument&id="+id;
    		
    		});
    		
    	});
    	
    </script>
	</body>

</html>